"use strict";
const mongoose = require("mongoose");
const CheckIn = mongoose.model("CheckIn");
const dbTool = require("../utils/db");
const insertOne = dbTool.insertOne.bind(CheckIn);
const find = dbTool.find.bind(CheckIn);
const count = dbTool.count.bind(CheckIn);
const createCheckIn = function(checkIn) {
	return insertOne(checkIn);
};
const getCheckIns = function() {
	return find({}, {
		_id:0,
		__v:0
	}).exec().then(dbTool.toSimpleObject);
};
const countCheckIns = function() {
	return count();
};
module.exports = {
	createCheckIn,
	countCheckIns,
	getCheckIns
};